{extend name='admin@public/content'}

{block name="content"}
<!-- 表单搜索 开始 -->
<form autocomplete="off" class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订单单号</label>
        <div class="layui-input-inline">
            <input name="order_no" value="{$Think.get.order_no}" placeholder="请输入订单单号" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">付款状态</label>
        <div class="layui-input-inline">
            <select name="pay_status" class="layui-select">
                <option value="">所有订单</option>
                <!--{foreach ["待付款","已付款"] as $k=>$v}-->
                {if $Think.get.pay_status eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                <!--{/foreach}-->
            </select>
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">订单状态</label>
        <div class="layui-input-inline">
            <select name="order_status" class="layui-select">
                <option value="">所有订单</option>
                <!--{foreach ["进行中","已关闭","已完成"] as $k=>$v}-->
                {if $Think.get.order_status eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                <!--{/foreach}-->
            </select>
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">发货状态</label>
        <div class="layui-input-inline">
            <select name="delivery_status" class="layui-select">
                <option value="">所有订单</option>
                {foreach ['未发货','已发货'] as $k=>$v}
                {if $Think.get.delivery_status eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                {/foreach}
            </select>
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">下单时间</label>
        <div class="layui-input-inline">
            <input name="create_at" data-time value="{$Think.get.create_at}" placeholder="请选择下单时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">支付时间</label>
        <div class="layui-input-inline">
            <input name="pay_time" data-time value="{$Think.get.pay_time}" placeholder="请选择支付时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<script>
    window.form.render();
    $('[data-time]').map(function () {
        window.laydate.render({range: true, elem: this});
    });
</script>
<!-- 表单搜索 结束 -->

<form autocomplete="off" onsubmit="return false;" data-auto="true" method="post">
    {if empty($list)}
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    {else}
    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none="none" data-check-target='.list-check-box' type='checkbox'/>
            </th>
            <th class="text-left nowrap padding-none">
                <table class="layui-table think-inner-table">
                    <colgroup>
                        <col width="70%">
                    </colgroup>
                    <tr>
                        <td>商品信息</td>
                        <td class="text-right">
                            价格 <span class="layui-icon font-s12">&#x1006;</span> 数量
                        </td>
                    </tr>
                </table>
            </th>
            <th class="text-left">订单金额</th>
            <th class="text-left">订单信息</th>
            <th class="text-left">会员信息</th>
            <th class="text-left">订单时间</th>
            <th class="text-left">发货信息</th>
            <th class="text-left">代理商</th>
            <th class="text-left">买家留言</th>
            <th class="text-left">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td text-top think-checkbox'>
                <input class="list-check-box" value='{$vo.order_id}' type='checkbox'/>
            </td>
            <td class="text-left text-top nowrap padding-none">
                <table class="layui-table think-inner-table">
                    <colgroup>
                        <col width="70%">
                    </colgroup>
                    {foreach $vo.goods as $goods}
                    <tr>
                        <td><img data-tips-image="" class="img" src="{$goods.goods_pic}" title="" style="">[{$goods.goods_id}] {$goods.goods_name}</td>
                        <td class="text-right">
                            <b>
                                {$goods.goods_price}
                                <span class="layui-icon font-s12">&#x1006;</span>
                                {$goods.total_num}
                            </b>
                        </td>
                    </tr>
                    {/foreach}
                </table>
            </td>


            <td class="text-left text-top nowrap">
                订单总额：￥{$vo.total_price}<br>
                运费金额：￥{$vo.express_price}<br>
                实付金额：￥{$vo.pay_price}
            </td>

            <td class="text-left text-top nowrap">
                订单单号：<b>{$vo.order_no}</b><br>
                付款状态：
                {switch name='vo.pay_status'}
                {case value='0'}<span class="layui-badge layui-bg-gray">待付款</span>{/case}
                {case value='1'}<span class="layui-badge layui-bg-blue">已付款</span>{/case}
                {/switch}
                <br>
                发货状态：
                {switch name='vo.delivery_status'}
                {case value='0'}<span class="layui-badge layui-bg-gray">待发货</span>{/case}
                {case value='1'}<span class="layui-badge layui-bg-blue">已发货</span>{/case}
                {/switch}<br>

                收货状态：
                {switch name='vo.receipt_status'}
                {case value='0'}<span class="layui-badge layui-bg-gray">待收货</span>{/case}
                {case value='1'}<span class="layui-badge layui-bg-blue">已收货</span>{/case}
                {/switch}

                <br>
            </td>
            <td class="text-left text-top nowrap">
                {$vo.member.nick_name|default='<span class="color-desc">未设置会员昵称</span>'|raw}(会员ID：{$vo.member.member_id})

            </td>
            <td class="text-left text-top nowrap">
                创建时间：{$vo.create_at}<br>
                支付时间：{$vo.pay_time}
            </td>
            <td class="text-left text-top nowrap">
                <!--{if auth('store/deliver/express') and $vo.delivery_status eq 0 and $vo.pay_status eq 1}-->
                <a data-title="快速发货" data-modal='{:url("$classuri/delivery")}?id={$vo.order_id}'><span class="layui-badge">快速发货</span></a>
                <!--{/if}-->
                {if $vo.express}
                快递公司：
                {$vo.express.express_name}
                <br>
                快递单号：{$vo.express_no|default='<span class="layui-badge layui-bg-blue">未发货</span>'|raw}
                <br>
                收货信息：{$vo.address.name} {$vo.address.mobile}<br>
                收货地址：{$vo.address.detail}
                <!--{if auth('store/order/address')}<a data-title="修改收货人信息" data-modal="{:url('order/address')}?order_no={$vo.order_no}">修改</a>{/if}-->
                {/if}
                {if !empty($vo.express)}<br>发货时间：{$vo.delivery_time|format_datetime}{/if}
            </td>
            <td class="text-left text-top nowrap">
                {if $vo.agent}
                代理ID：{$vo.agent.agent_id}<br>
                姓名：{$vo.agent.name}<br>
                手机号：{$vo.agent.mobile}<br>
                {/if}
            </td>
            <td class="text-left text-top" width="10%">
                {$vo.remark}
            </td>
            <td class="text-left text-top nowrap">
                 -
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    {/if}
</form>
<style>
    .img {
        width: 25px;
        height: 25px;
        /*border-radius: 50%;*/
        margin-right: 10px;
    }

</style>
{/block}
